package com.pantuo.sys.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CommonDao {

    //@Param("map")
    void insertObject(@Param("map") Map<String, Object> map);

    void insertsfzlog(@Param("map") Map<String, Object> map);

    void updateObject(@Param("map") Map<String, Object> map);

    public int deleteObject(String className, Integer... id);

    public Boolean deleteByField(String dbField, String value, String className);

    List<String> findColumnNames(String className);

    void addColumn(@Param("className") String className,
                   @Param("columnName") String columnName);

    /*public List<Map<String, Object>> findAllObjects(@Param("map1") Map<String, String> map1,
                                                    @Param("map2") Map<String, String> map2,
                                                    Integer start,
                                                    Integer length,
                                                    String className);*/

    public List<Map<String, Object>> findAllObjects(@Param("map1") Map<String, String> map1,
                                                    @Param("orderList") List<Map<String, String>> orderList,
                                                    Integer start,
                                                    Integer length,
                                                    String className);

    public Long getTotal(@Param("map1") Map<String, String> map1, String className);

    public Map<String, Object> findObjectById(String id, String className);

    public List<String> findSql(String className);

    public List<Map<String, Object>> findAllObjectsByJoin(@Param("map1") Map<String, String> map1,
                                                          @Param("orderList") List<Map<String, String>> orderList,
                                                          Integer start,
                                                          Integer length,
                                                          String sql);

    public Long getTotalByJoin(@Param("map1") Map<String, String> map1, String sql);

}
